<!DOCTYPE html>
<!--
     SPDX-License-Identifier: CC-BY-SA-4.0
     SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC.
-->
<!-- Page last generated 2025-02-20 03:16:15 +0000 -->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Git conventions | seL4 docs</title>

    <!-- Our stylesheet and theme stylesheet.  Contains bootstrap. -->
    <link rel="stylesheet" href="/assets/css/style.css" type="text/css">
    <!-- Font awesome -->
    <link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
    <!-- Pygments syntax highlighting  -->
    <link rel="stylesheet" href="/assets/css/highlighting/trac.css" type="text/css">
    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico"><script defer data-domain="docs.sel4.systems"
	    src="https://analytics.sel4.systems/js/script.js"></script></head>

  <body class="container-fluid">

    



<header>
  <ul class="row menu">
    <li class="col-xs-12 col-md-2" >
            <a href="https://sel4.systems" class="skip-icon">
              <img class="img-responsive" src="/assets/logo-text-white.svg" alt="seL4 logo" />
            </a>
    </li>
    <li class="col-xs-12 col-md-10 menu">
      <nav aria-label="Banner links">
        <h2><a href="/Resources" />Resources</h2>
        <h2><a href="/processes" />Contributing</a></h2>
        <h2><a href="/projects" />Projects</h2>
        <h2><a href="/Tutorials" />Tutorials</h2>
        <iframe title="DuckDuckGo search bar" src="https://duckduckgo.com/search.html?site=docs.sel4.systems&prefill=Search%20sel4.systems" style="overflow:hidden;margin-bottom:10px; padding:0;height:40px;float:right;border-width: 0px"></iframe>
      </nav>
    </li>
  </ul>
  <div class="clear"></div>
  
<div class="breadcrumbs bootstrap hidden-sm-down">
  <nav class="sel-breadcrumb" aria-label="Breadcrumb" >
    <ol class=" list-unstyled" vocab="http://schema.org/" typeof="BreadcrumbList">
      
      
        

        

        <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <a property="item" typeof="WebPage" href="/">
              <span property="name"><b>seL4 Docs</b></span>
            </a>
            <meta property="position" content="1" />
        </li>
      
        

        

        <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <a property="item" typeof="WebPage" href="/processes/">
              <span property="name"><b>Processes</b></span>
            </a>
            <meta property="position" content="2" />
        </li>
      
        

        
          <li class="breadcrumb-item" property="itemListElement" typeof="ListItem">
            <span property="name">Git conventions</span>
            <meta property="position" content="3" /></li>
          
    </ol>
  </nav>
  <nav class="sel-version" aria-label="Current Versions">
    <ol class="list-unstyled">
      <li class="list-unstyled text-right" style="margin-left:auto; padding:0rem 0rem;">
        Current versions:</li>
      <li class="list-unstyled text-right">
      <a href="/releases/sel4/13.0.0"><b>seL4-13.0.0</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/microkit/1.4.1"><b>microkit-1.4.1</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/camkes/camkes-3.11.0"><b>camkes-3.11.0</b></a></li>
      <li class="list-unstyled text-right">
      <a href="/releases/capdl/0.3.0"><b>capDL-0.3.0</b></a></li>
      </ol>
  </nav>
  <div class='clear'></div>
</div>


</header>

    <main>
      <div class="row">
  <div class="hidden-xs col-sm-4 col-md-3 col-lg-2">
    


<div class="sidebar">






      <ul class="nav nav-sidebar">
  
        <li class="">
          <a class="" href="/processes/conduct.html">
            Code of Conduct
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/contributing.html">
            Contributing
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/licenses.html">
            Licensing
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/style-guide.html">
            Style Guide
          </a>
        </li>
  
        <li class="active">
          <a class="" href="/processes/git-conventions.html">
            Git Conventions
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/code-review.html">
            Pull requests
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/release-process.html">
            Release process
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/rfc-process.html">
            RFC process
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/test-status.html">
            Test Status
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/websites.html">
            Websites
          </a>
        </li>
  
        <li class="">
          <a class="" href="/processes/emails.html">
            Emails
          </a>
        </li>
  
        <li class="">
          <a class="" href="/MaintainedRepositories.html">
            Maintained Repositories
          </a>
        </li>
  
      </ul>











</div>

  </div>
  <div class="col-sm-8 col-md-9 col-lg-8 main">
    
      <nav aria-label="Table of Contents">
        <ul id="toc" class="section-nav">
<li class="toc-entry toc-h2"><a href="#commit-messages">Commit messages</a></li>
<li class="toc-entry toc-h2"><a href="#whitespace-and-style">Whitespace and style</a></li>
<li class="toc-entry toc-h2"><a href="#history">History</a></li>
<li class="toc-entry toc-h2"><a href="#further-resources">Further resources</a></li>
</ul>
      </nav>
    
    <div class="content">
      <h1 id="git-conventions">Git conventions</h1>

<p>This page outlines the conventions we attempt to use for our git history. Note that this applies to
pull requests where the content is ready to merge to the master branch.
If you are raising a pull request for feedback, you do not
need to follow the history conventions, but please note this in the description of the pull request
to avoid confusion.</p>

<p>We will review the history in pull requests that are in a <em>ready to merge</em> state. If you need help
with git, or advice on how to structure your history, please reach out.</p>

<p>Note that our work-flow is a <a href="https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow">fork-rebase
workflow</a>.</p>

<h2 id="commit-messages">Commit messages</h2>

<p>Please follow the git commit <a href="https://chris.beams.io/posts/git-commit/">style guide</a>. Briefly:</p>

<ul>
  <li>Use a subject line to summarize the commit.</li>
  <li>Limit the subject line to roughly 50 characters.</li>
  <li>Capitalise the subject line.</li>
  <li>Avoid endpoint the subject line in a full stop.</li>
  <li>Use the imperative mood in the subject line.</li>
  <li>Follow this with a blank line, then a summary of why the changes are required, and if non-trivial,
how they are required.</li>
  <li>Wrap the body at 72 chars.</li>
</ul>

<h2 id="whitespace-and-style">Whitespace and style</h2>

<ul>
  <li>Please keep whitespace and style changes in their own commits, not mixed with other changes.</li>
  <li>If making a trivial commit, please prefix with <code class="language-plaintext highlighter-rouge">trivial:</code></li>
  <li>Avoid making PRs that are only changing style and not making other significant changes.
This avoids spending reviewer and CI resources on a large number of small stylisitic improvements.</li>
</ul>

<h2 id="history">History</h2>

<ul>
  <li>Merge commits are prohibited.</li>
  <li>Revert commits which act on the contents of the PR are prohibited.</li>
  <li>Commits should make the changes easier to follow: if you move a function and change it, please do
so in separate commits.</li>
  <li>Commits should be separated into functional, logical changes, unless those changes are dependant.
if you find yourself writing a commit message which says ‘Fix X and clean up Y’, you should
    probably use two commits.</li>
</ul>

<h2 id="further-resources">Further resources</h2>

<ul>
  <li><a href="http://pcottle.github.io/learnGitBranching/">LearnGitBranching</a></li>
  <li>Interactive <a href="http://ndpsoftware.com/git-cheatsheet.html#loc=stash">Git cheat sheet</a></li>
</ul>


    </div>
  </div>
</div>

    </main>
    


<footer class="site-footer">

  <h2 class="footer-heading">seL4 docs</h2>

  <div class="footer-col-wrapper">

    <div class="col-md-2">
      



<ul class="social-media-list">
  <li><a href="https://github.com/sel4"><i class="fab fa-github"></i> <span class="username">sel4</span></a></li><li><a href="https://github.com/sel4proj"><i class="fab fa-github"></i> <span class="username">sel4proj</span></a></li>
</ul>

    </div>

    <div class="col-md-8">
      <ul class="list-unstyled">
        <li>
          This site is for displaying seL4 related documentation.  Pull requests are welcome.
        </li>
        
          <li>
            Site last updated: Fri Feb 7 10:17:38 2025 +1100 ee78c8857c
          </li>
          <li>
                Page last updated: Sat Jan 8 09:23:51 2022 +1100 12bd2f5a6d
          </li>
        
      </ul>
    </div>
    <div class="col-md-2">
<a href="https://github.com/seL4/docs/blob/master/processes/git-conventions.md">View page on GitHub</a>
      <br />
      <a href="https://github.com/seL4/docs/edit/master/processes/git-conventions.md">Edit page on GitHub</a>
      <br />
      <a href="/sitemap">Sitemap</a>
    </div>

  </div>

</footer>

  </body>
</html>
